package observer.advanced;

/**
 * 秘书通知者
 * @author Chen Guang
 * @date 2019/4/9 0009 下午 16:13
 */
public class SecretarySubject implements Subject {

    /**
     * 通知者状态
     */
    private String subjectState;
    /**
     * 委托事件
     */
    private EventHandler eventHandler = new EventHandler();

    @Override
    public void notifyObserver() throws Exception{
        eventHandler.notifyAllEvenr();
    }

    @Override
    public void attach(Object object,String methodName,Object...args) {
        eventHandler.addEvent(object, methodName, args);
    }

    @Override
    public String getSubjectState() {
        return subjectState;
    }

    @Override
    public void setSubjectState(String str) {
        this.subjectState = str;
    }
}
